//JavaScript Framework 2.0 Code
try {
	Type.registerNamespace('com.yonyou.ncmm_pac_pda.MaterialRowRefPageController');
	com.yonyou.ncmm_pac_pda.MaterialRowRefPageController = function() {
		com.yonyou.ncmm_pac_pda.MaterialRowRefPageController.initializeBase(this);
		this.initialize();
	}

	function com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$initialize() {

	}

	function com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$evaljs(js) {
		eval(js);
	}

	function txtfilter_oninput(sender, args) {
		var billinfos = $ctx.getJSONArray("originalbillinfos");
		if(args.newvalue == "") {
			$ctx.put("billinfos", billinfos);
			$ctx.dataBind();
			return;
		}
		if(!billinfos || billinfos.length == 0) {
			return;
		}
		var billinfostmp = [];
		var len = billinfos.length;
		for(var idx = 0; idx < len; idx++) {
			var billinfo = $stringToJSON(billinfos[idx]);
			if((billinfo["code"]).indexOf(args.newvalue) > -1 ||
				(billinfo["name"]).indexOf(args.newvalue) > -1 ||
				(billinfo["rowno"]).indexOf(args.newvalue) > -1) {
				billinfostmp.push(billinfo);
			}
		}

		$ctx.put("billinfos", billinfostmp);
		$ctx.dataBind();
	}

	function onitemclick(sender, args) {
		var data = $id('listviewref').get('row');
		data = $stringToJSON(data);
		$view.closeWithCallBack({
			"data": data["index"]
		});
	}

	function com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$btnback_onclick(sender, args) {
		$view.close();
	}

	function onPageLoad(sender, args) {
		var param = $param.getJSONObject("data");
		//		$alert("param="+$jsonToString(param));
		$id("navigatorbarref").set("title", "物料行");
		var jsondata = {
			billinfos: param,
			originalbillinfos: param
		};
		$ctx.push(jsondata);
	}
	com.yonyou.ncmm_pac_pda.MaterialRowRefPageController.prototype = {
		btnback_onclick: com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$btnback_onclick,
		initialize: com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$initialize,
		evaljs: com$yonyou$ncmm_pac_pda$MaterialRowRefPageController$evaljs
	};
	com.yonyou.ncmm_pac_pda.MaterialRowRefPageController.registerClass('com.yonyou.ncmm_pac_pda.MaterialRowRefPageController', UMP.UI.Mvc.Controller);
} catch(e) {
	$e(e);
}